[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 registerbgifont()       Register Linked-in Stroked Fonts

 #include   <graphics.h>

 int far    registerbgifont(font);
 void       (*font)(void);

    registerbgifont() allows a different font file to be linked
    directly into your program file. C++ provides on disk the
    font files (*.CHR files) found in the following list. The
    parameter needed by registerbgifont() to register the font file is
    one of the symbolic names (defined in graphics.h) below:

     Font file           registerbgifont
     (*.CHR)             symbolic name

     TRIP                triplex_font
     LITT                small_font
     SANS                sansserif_font
     GOTH                gothic_font

    Before registerbgifont() can be called, there are several steps that
    must be gone through. The specified font file (*.CHR file) must first
    be converted to an object file using BGIOBJ.EXE. For example:

               bgiobj sans

    creates SANS.OBJ.

    Then the object file must be added to GRAPHICS.LIB using TLIB.

               tlib graphics +sans

    Finally the driver file is registered in your graphics program using
    registerbgifont().  registerbgifont() must be called before
    initgraph().

    Returns:    The font number of the registered font, on success.  If
                the specified font is invalid, a negative graphics error
                code is returned.

   -------------------------------- Example ---------------------------------

           #include <graphics.h>

           int gdriver = DETECT, gmode;

           main()
           {
               if (registerbgifont(gothic_font) < 0) {
                   printf("invalid font\n");
                   getch();
               }
               else {
                   initgraph(&gdriver,&gmode,"");

                   /* graphic operations */

                   closegraph();
               }
           }


See Also: initgraph() registerbgidriver()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson